Convert mp3 to wav

chris (2005-04-05 17:24:59)
3858 views
0 replies
I needed to convert a bunch of mp3 tracks to raw PCM style wav files today. It's easy enough to do and after a bit of fiddling with mpg123, sox and sh here is a helper script to do the job:
#!/bin/sh
# christo chris@uk.com 05/04/05
# convert all the mp3s in this folder to wav format, keeping the originals intact
for MP3 in *.mp3
do
   WAV="${MP3%.mp3}.wav"
   echo "Converting $MP3 to $WAV"
   [ ! -s "${WAV}" ] && (mpg123 -b 10000 -s "$MP3" | 
   sox -s -w -c2 -t raw -r 44100 - -t wav -> "$MP3".wav)
done

christo
comment